import './Mars3dSetUp.scss'
import { Button } from 'antd'
import PropTypes from 'prop-types'

import { optionsList } from '../../Assets/Params'
import { UseConfigSection } from '../../Template/FormTemplate'

const Mars3dFitA03 = ({ data, Off, ModalEvent }) => {
    Mars3dFitA03.propTypes = { data: PropTypes.object, Off: PropTypes.func, ModalEvent: PropTypes.object }

    const list = [
        { key: 101, uuid: 'FitA03', label: '地球底色', type: 'ColorPickerTemp', name: 'baseColor', options: optionsList.isEnable },
        { key: 102, uuid: 'FitA03', label: '瓦片图层', type: 'SelectTemp', name: 'basemap', options: optionsList.baseList },
        { key: 103, uuid: 'FitA03', label: '瓦片图层', type: 'SelectMultipleTemp', name: 'layer', options: optionsList.layerList },
    ]

    const onSubmit = () => {
        ModalEvent.emit({ type: 'scene', data })
        Off()
    }

    return (
        <div className='Mars3dSetUp Mars3dFitA03'>
            <div className='FormList'>
                {UseConfigSection(data, list)}
            </div>
            <div className='Button'>
                <Button type='primary' danger onClick={Off}>取消</Button>
                <Button type='primary' onClick={onSubmit}>保存</Button>
            </div>
        </div>
    );
};

export default Mars3dFitA03;